package top.xiaozhaobk.xiaofenshu.oss.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import top.xiaozhaobk.framework.common.response.Response;
import top.xiaozhaobk.xiaofenshu.oss.config.FeignFormConfig;
import top.xiaozhaobk.xiaofenshu.oss.constant.ApiConstants;

@FeignClient(name = ApiConstants.SERVICE_NAME,configuration = FeignFormConfig.class) //服务名称
public interface FileFeignApi {
    String PREFIX = "/file";

    @PostMapping(value = PREFIX + "/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response<?> uploadFile(@RequestPart("file") MultipartFile file);
}
